
<%@ page import="aiball.UserAccount" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'userAccount.label', default: 'UserAccount')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#show-userAccount" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
			</ul>
		</div>
		<div id="show-userAccount" class="content scaffold-show" role="main">
			<h1>Ihre persönlichen Daten</h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<ol class="property-list userAccount">
			
				<g:if test="${userAccountInstance?.username}">
				<li class="fieldcontain">
					<span id="username-label" class="property-label">Benutzername:</span>
					<span class="property-value" aria-labelledby="username-label"><g:fieldValue bean="${userAccountInstance}" field="username"/></span>
				</li>
				</g:if>
			
				<g:if test="${userAccountInstance?.email}">
				<li class="fieldcontain">
					<span id="email-label" class="property-label"><g:message code="userAccount.email.label" default="Email" />:</span>
					<span class="property-value" aria-labelledby="email-label"><g:fieldValue bean="${userAccountInstance}" field="email"/></span>
				</li>
				</g:if>
			
				<g:if test="${userAccountInstance?.lastActivity}">
				<li class="fieldcontain">
					<span id="lastActivity-label" class="property-label">letzte Aktivität:</span>
					<span class="property-value" aria-labelledby="lastActivity-label"><g:formatDate date="${userAccountInstance?.lastActivity}" /></span>
				</li>
				</g:if>
				
				<!-- Team-Feld nur anzeigen, wenn Team nicht DefaultTeam -->
				
				<g:if test="${userAccountInstance?.team}">
				<li class="fieldcontain">
					<span id="team-label" class="property-label"><g:message code="userAccount.team.label" default="Team" />:</span>
					<span class="property-value" aria-labelledby="team-label"><g:link controller="team" action="show" id="${userAccountInstance?.team?.id}">${userAccountInstance?.team?.name.encodeAsHTML()}</g:link></span>
				</li>
				</g:if>
				
			</ol>
			<g:form>
				<fieldset class="buttons">
					<g:hiddenField name="id" value="${userAccountInstance?.id}" />
					<g:link class="edit" action="edit" id="${userAccountInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
				<g:if test="${springSecurityService?.getPrincipal()?.getAuthorities()?.toString()?.equals("[ROLE_ADMIN]") }">
					<g:if test="${(UserAccount.get(params.get('id'))).enabled}">
						<g:link class="suspend" action="suspend" id="${userAccountInstance?.id}">Team deaktivieren</g:link>
					</g:if>
					<g:else>
						<g:link class="aktivate" action="aktivate" id="${userAccountInstance?.id}">Team aktivieren</g:link>
					</g:else>
				</g:if>
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
